<?php
	class TestCtl extends  BaseCtl {
		public function TestCtl() {
			parent::BaseCtl();
		}
    	public function isPostback(){
    		return "test" == $this->getPost("pagename");
    	}

    	public function loadData(){
    		// for now, not implementation
    	}
    	
    	public function tester(){
    		HtmlUtil::addMessage('tester worked fine');
    	}
    	
    	public function login(){
    		$form = $this->getLoginForm();
    		
    		$form->setLogin('login here');
    		$form->setPassword('the other value');
    		
    		$this->redirect('index.php');
    	}
    	
    	public function profile(){
    		
			$form = $this->getProfileForm();
			
    		$form->setLogin('login here');
			$form->setName('the full name');
			$form->setConnect(true);
			$form->setAdmin(true);
			$form->setEmail('alfa@alfa.com');
			$form->setSendEmail(true);
    		    		
    		$this->redirect('profile.php');
    	}
    	
    	public function editalbum(){
    		$form = $this->getEditAlbumForm();
    		
    		$form->setId('go ahead with id here');
    		$form->setName('name here');
    		$form->setAdding(false);
    		
    		$this->redirect('editalbum.php');
    	}
    	
    	public function chownpass(){
    		$form = $this->getChownPassForm();
    		
    		$form->setOld('the old stuff');
    		$form->setPass('pass one'); 
    		$form->setRepeat('pass two');
    		$form->setReadonly(true);
    		
    		$this->redirect('chownpass.php');
    	}
    	
    	public function chpass(){
    		$form = $this->getChPassForm();
    		
    		$form->setId('id here');
    		$form->setName('the name considered'); 
    		$form->setLogin('de login'); 
    		
    		$form->setPass('first pass');
    		$form->setRepeat('repeat pass');
    		
    		$this->redirect('chpass.php');
    	}
    	
    	public function editpicture(){
    		$form = $this->getEditPictureForm();
    		
    		$form->setId('id here');
    		$form->setName('and the name is here');
    		$form->setAdding(false);
    		$form->setAlbumId('the album id here');
    		$form->setAlbumName('the name < of the game');
    		
    		$this->redirect('editpicture.php');
    	}
    	
    	public function edituser(){
    		$form = $this->getEditUserForm();
    		
			$form->setAdding(false);
			$form->setId('some id');
			$form->setLogin('login here');
			$form->setName('name here');
			$form->setAdmin(false);
			$form->setConnect(false);
			$form->setEmail('alfa@alfa.com');
			$form->setSendEmail(false);
    		    		
    		$this->redirect('edituser.php');
    	}
    	
    	public function confirmalbum(){
    		$form = $this->getConfirmAlbumForm();
    		
    		$arr = array();
    		
    		for($i = 0; $i < 5; $i++){
    			$album = new Album();
    			
    			$album->setId("id{$i}"); 
    			$album->setPictureId("0{$i}");
    			$album->setName("name here {$i}");
    			
    			$arr[] = $album;
    		}
    		
    		$form->setAlbums($arr);
    		
    		$this->redirect("confirmalbum.php");
    		
    		
    	}
    	
    	public function confirmpicture(){
    		$form = $this->getConfirmPictureForm();
    		
    		$arr = array();
    		
    		for($i = 0; $i < 5; $i++){
    			$picture = new Picture();
    			
    			$picture->setId("0{$i}"); 
    			$picture->setComments("name here {$i}");
    			
    			$arr[] = $picture;
    		}
    		
    		$form->setPictures($arr);
    		
    		$this->redirect("confirmpicture.php");
    	}
    	
    	public function users(){
    		$form = $this->getUsersForm();
    		$arr = array();
    		
    		for($i = 0; $i < 10; $i++){
    			$current = new User();

    			$current->setId('id_' . $i);
    			$current->setAdmin(false);
    			$current->setConnect(false);
    			$current->setName('name here' . $i);
    			$current->setLogin('login here' . $i);
    			$current->setEmail('alfa@alfa.com' . $i);
    			$current->setSendEmail(true);
    			
    			$arr[] = $current;
    		} // for
   			
   			$form->setUsers($arr);
   			
   			$this->redirect('users.php');
    	}
    	
    	public function albums(){
    		$form = $this->getAlbumsForm();
    		
    		$arr = array();
    		
    		for($i = 0; $i < 5; $i++){
    			$album = new Album();
    			
    			$album->setId("id{$i}"); 
    			$album->setPictureId("0{$i}");
    			$album->setName("name here {$i}");
    			
    			$arr[] = $album;
    		}
    		
    		$form->setAlbums($arr);
    		$form->setSearch('test search here');
    		$form->setSelected(array('id1'));
    		
    		$this->redirect('albums.php');
    	}
    	
    	public function pictures(){
    		$form = $this->getPicturesForm();
    		
    		$form->setAlbumId('id there');
    		$form->setAlbumName('the name of thegame');

    		$arr = array();
    		
    		for($i = 0; $i < 10; $i ++){
    			$current = new Picture();
    			
    			$current->setComments("comments here {$i}");
    			$current->setId("0{$i}");
    			
    			$arr[] = $current;
    		}
    		
    		$form->setPictures($arr);
    		$form->setSelected(array('02'));
    		
    		$this->redirect('pictures.php');
    	}
    	
    	public function mupload(){
    		$form = $this->getMUploadForm(); 
    		$form->clear();
    		
    		$form->setAlbumId('idhere');
    		$form->setAlbumName('name of the album here');

    		$this->redirect('mupload.php');
    	}
    	
    	public function renalbums(){
    		$this->redirect('renalbums.php');
    	}
    	
    	public function movealbums(){
    		$form = $this->getMovealbumsForm();
    		$form->clear();
    		
    		// users
    		$users = array();
    		for($count = 0; $count < 5; $count ++){
    			$current = new User();
    			
    			$current->setId("id_{$count}");
    			$current->setName("name here: {$count}");
    			
    			$users[] = $current;
    		}
    		
    		$form->setUsers($users);
    		
    		// albums
    		
    		$albums = array();
    		for($count = 0; $count < 10; $count ++){
    			$current = new Album();
    			
    			$current->setId("other $count");
    			$current->setName("the name here for the {$count} album");
    			
    			$albums[] = $current;  
    		}
    		
    		$form->setAlbums($albums);
    		
    		$this->redirect('movealbums.php');
    	}
    	
    	public function joblist(){
    		$form = $this->getJoblistForm();
    		
    		$form->clear();
    		$s = array();
    		
    		for($count = 0; $count < 10; $count ++){
    			$job = new Job();
    			$job->setId("id_{$count}");
    			$job->setName("the name for the current {$count} will be set here");
    			$job->setStatus("alfa{$count}");
    			$job->setUserId('iduser_' . $count);
    			
    			$s[] = $job;
    		}
    		
    		$form->setJobs($s);
    		
    		$this->redirect('joblist.php');
    	}
    	
    	public function jobedit(){
    		$form = $this->getJobeditForm();
    		
    		$form->clear();
    		
    		$form->setId('id here');
    		$form->setName('name here'); 
    		$form->setAdding(false);
    		$form->setStatus('second');
    		$form->setStatusList(array('first', 'second', 'third', 'fourth'));
    		
    		$this->redirect('jobedit.php');
    	}
    	
    	public function jobselect(){
    		$form = $this->getJobselectForm();
    		
    		$form->clear();
			$form->setJobId('jobid'); 
			$form->setJobName('the job name there');
			
			$albums = array();
			$alfa = new Album();
			$alfa->setId('second'); 
			$alfa->setName('the name of the album');
			
			$albums[] = $alfa;
			
			$form->setAlbums($albums);
			$form->setAlbumId('second'); 
			$form->setPictures(array('pict1', 'other one', 'tetra'));
			$form->setJobPictures(array('second', 'fourth'));
    		
    		
    		$this->redirect('jobselect.php');
    	}
    	
	} 
?>